<template>
  <el-container style="height:100%;">
    <el-aside  :style="{width:(isCollapse?'auto':'260px')}" style="overflow-x: hidden;">
      <LeftMenu ref="LeftMenu" :isCollapse="isCollapse" @clickMenu="clickMenu($event)" ></LeftMenu>
    </el-aside>
    <el-container>
      <el-header>
        <Header @radioChanges="radioChanges" :isCollapse="isCollapse" :curent='curent'></Header>
      </el-header>
      <el-main style="box-shadow: 0px -1px 5px #ccc;">
        <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
import LeftMenu from "./LeftMenu";
import Header from "../components/header";
export default {
  components: {
    LeftMenu,
    Header
  },
  data() {
    return {
      activeIndex2: "1",
      role: JSON.parse(localStorage.getItem("qx")),
      RouterArr: [],
      isCollapse: false,
      curent:{},
    };
  },
  created() {
    //解决点击左侧菜单点击出错
    this.$router.addRoutes(this.$utils.CreatedRouter());
    // this.CreatedRouter()
  },
  methods: {
    radioChanges() {
      this.isCollapse = !this.isCollapse;
    },
    clickMenu(val){
      console.log(val);
      // this.curent = val
    }
  }
};
</script>
<style lang="less">
</style>